package net.alche.ext.dbUtil.connect;
import net.alche.al.util.far.pojo.PageList;
import net.alche.ext.dbUtil.connect.def.DbConfig;
import net.alche.ext.dbUtil.connect.dbs.DBUtil;
import net.alche.fa.core.model.FaSqlInfo;
import java.util.Map;
import java.util.List;

//
// 执行SQL
//
@SuppressWarnings("all") 
public class DbExecSql {
    private static final ThreadLocal<PageList> LOCAL_PAGE = new ThreadLocal<>();
    DBConnect dbConnect;

  public static PageList popPage() {
    PageList pageList = LOCAL_PAGE.get();
    if (pageList != null) {
      LOCAL_PAGE.remove();
    }
    return pageList;
  }

  public static void setPage(PageList pageList) {
    LOCAL_PAGE.set(pageList);
  }

  public DbExecSql(DbConfig config) {
    dbConnect = DBUtil.getDbConnect(config);
  }

  public int insertFa(FaSqlInfo sqlInfo) {
    return 0;
  }

  public int updateFa(FaSqlInfo sqlInfo) {
    return 0;
  }

  public int deleteFa(FaSqlInfo sqlInfo) {
    return 0;
  }

  public Map selectOne(FaSqlInfo sqlInfo) {
    return null;
  }

  public List selectList(FaSqlInfo sqlInfo) {
    return null;
  }
}